<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>选择老人信息</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('AdminLaoren/gdlrlist')}">
        姓名:
        <input type="text" class="form-control" name="keyword" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入关键字">
        卡号:
        <input type="text" class="form-control" name="zjnum" style="width: 200px;" value="{$zjnum|default=''}"
            placeholder="请输入卡号">
        联系方式:
        <input type="text" class="form-control" name="tel" style="width: 200px;" value="{$tel|default=''}"
            placeholder="请输入联系方式">
        地区:
        <input class="form-control" type="text" style="width:300px;" required value="" placeholder="请选择社区"
               onclick="doSelectCategory();" id="js-categories-name-input" readonly />
        <input class="form-control" type="hidden" value="" name="category" id="js-categories-id-input" />
        <button class="btn btn-primary">搜索</button>
    </form>
    <form class="js-ajax-form" method="post">
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="80">序号</th>
                <th width="80">老人编号</th>
                <th  width="160">姓名</th>
                <th width="160">性别</th>
                <th width="160">年龄</th>
                <th width="160">联系方式</th>
                <th width="160">老人类型</th>
                <th width="160">住址</th>
                <th width="160">卡号</th>
                <th width="100">余额</th>
                <th width="80">状态</th>
                <th width="200">操作</th>
            </tr>
            </thead>
            <php>$status=array("1"=>'已发布',"0"=>'未发布');</php>
            <foreach name="pages" item="vo">
                <tr>
                    <td>{$xhpage + $key}</td>
                    <td>{$vo.more.bianma}</td>
                    <td>{$vo.post_title}</td>
                    <td>{$vo.more.sex}</td>
                    <td>{$vo.more.age}</td>
                    <td>{$vo.more.tel}</td>
                    <td>{$vo.more.butietype|default=''}</td>
                    <td>{$vo.more.add}</td>
                    <td>{$vo.more.dbznum}</td>
                    <td>{$vo.money}</td>
                    <td>
                        <notempty name="vo.post_status">
                            <a data-toggle="tooltip" title="已发布"><i class="fa fa-check"></i></a>
                            <else/>
                            <a data-toggle="tooltip" title="未发布"><i class="fa fa-close"></i></a>
                        </notempty>
                    </td>
                    <td>
                        <a class="btn btn-xs btn-primary" href="{:url('AdminOrder/add',array('id'=>$vo['id'], 'category'=>$category, 'page'=>$pageth))}">录单</a>
                    </td>
                </tr>
            </foreach>
            <!-- <tfoot>
            <tr>
                <th width="100">ID</th>
                <th width="80">老人编号</th>
                <th  width="160">姓名</th>
                <th width="160">性别</th>
                <th width="160">年龄</th>
                <th width="160">老人类型</th>
                <th width="160">出生日期</th>
                <th width="160">卡号</th>
                <th width="100">余额</th>
                <th width="80">状态</th>
                <th width="200">操作</th>
            </tr>
            </tfoot> -->
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    function doSelectCategory() {
        var selectedCategoriesId = $('#js-categories-id-input').val();
        openIframeLayer("{:url('AdminCategory/sqselect')}?ids=3,4,5,6,7,8,9,10,11&yxid=" + selectedCategoriesId, '请选择社区', {
            area: ['700px', '400px'],
            btn: ['确定', '取消'],
            yes: function (index, layero) {
                //do something

                var iframeWin = window[layero.find('iframe')[0]['name']];
                var selectedCategories = iframeWin.confirm();
                if (selectedCategories.selectedCategoriesId.length == 0) {
                    layer.msg('请选择社区');
                    return;
                }
                $('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
                $('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' '));
                //console.log(layer.getFrameIndex(index));
                layer.close(index); //如果设定了yes回调，需进行手工关闭
            }
        });
    }
</script>
</body>
</html>